package com.mxpio.webapp.entity;

import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * HTTP信息表
 *
 * @author: Cheng
 * @date: 2022/10/31
 */
@Entity
@Table(name = "MI_MONITOR_HTTP")
@ToString
@Data
@Schema(description = "HTTP信息表")
public class MonitorHttp extends BaseEntity {


    @Id
    @Generator
    @Schema(description = "id")
    @Column(name = "id", length = 64)
    private String id;

    @Schema(description = "主机名（来源）")
    @Column(name = "HOSTNAME_SOURCE")
    private String hostnameSource;

    @Schema(description = "URL地址（目的地）")
    @Column(name = "URL_TARGET", length = 128)
    private String urlTarget;

    @Schema(description = "请求方法")
    @Column(name = "METHOD", length = 32)
    private String method;

    @Schema(description = "请求参数")
    @Column(name = "PARAMETER", length = 512)
    private String parameter;

    @Schema(description = "描述")
    @Column(name = "DESCR", length = 255)
    private String descr;

    @Schema(description = "平均响应时间（毫秒）")
    @Column(name = "AVG_TIME")
    private Long avgTime;

    @Schema(description = "状态")
    @Column(name = "STATUS", length = 16)
    @Dict(dicCode = "MI_MONITOR_STATUS")
    private Integer status;

    @Schema(description = "异常信息")
    @Column(name = "EXC_MESSAGE")
    private String excMessage;

    @Schema(description = "离线次数")
    @Column(name = "OFFLINE_COUNT")
    private Integer offlineCount;

    @Schema(description = "监控环境")
    @Column(name = "MONITOR_ENV")
    private String monitorEnv;

    @Schema(description = "监控分组")
    @Column(name = "MONITOR_GROUP")
    @Dict(dicCode = "MI_MONITOR_GROUP")
    private String monitorGroup;
}
